//
//  YFAlternativeView.h
//  SquashSpark
//
//  Created by Coollang on 2017/11/16.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface  AlternativeItem: NSObject

/** 未选中状态显示的字符 */
@property (nonatomic, copy)NSString *unSelectText;
/** 选中状态的显示的字符 */
@property (nonatomic, copy)NSString *selectText;
/** 未选中状态文字颜色:deflaut kTLightGray999 */
@property (nonatomic, strong) UIColor *unselectTextColor;
/** 选中状态文字颜色:deflaut kTLightGray999 */
@property (nonatomic, strong) UIColor *selectTextColor;

// 采用此方法实例化： unSelectText与selectText相同
+ (instancetype)AlternativeItemWithSelectText:(NSString *)selectText;

+ (instancetype)AlternativeItemWithSelectText:(NSString *)selectText unselectText:(NSString *)unselectText;

@end

typedef enum : NSUInteger {
    kUnselect = 0,
    kSelectFirst,
    kSelectSecond,
} kAlternativeSelect;

// 二选一的弹窗，如：性别，左右手
@interface YFAlternativeView : UIView

/** title */
@property (nonatomic, copy) NSString *title;
/** 确认按钮文字 */
@property (nonatomic, copy)NSString *confirmBtnTitle;

@property (nonatomic, strong) AlternativeItem *firstItem;
@property (nonatomic, strong) AlternativeItem *secondItem;

/** 当前选中了第几个从 0 开始 */
@property (nonatomic, assign) kAlternativeSelect currentIndex;

// 前面圆点图片L可以替换成其他的:有默认值
@property (nonatomic, strong) UIImage *selectDotImage;
@property (nonatomic, strong) UIImage *unselectDotImage;


+ (instancetype)alternativeViewWithTitle:(NSString *)title first:(AlternativeItem *)firstItem second:(AlternativeItem *)secondItem currentValue:(kAlternativeSelect)currentSelect;

@property (nonatomic, copy)void(^ConfirmButtonBlock)(kAlternativeSelect currntSelect,AlternativeItem *selectItem);

@end
